/**
 * @description  获取课程列表
 * @param { Number,String } page 页码
 * @returns
 */

export function useCourseListApi(page) {
    return useHttpGet("CourseList", `/course/list?page=${page}`, {
        lazy: true
    })
}


/**
 * @description  查看课程详情
 * @param { Object } query 页码
 * @returns
 */

export function useReadCourseApi(query = {}) {
    let q = useQueryToString(query);
    return useHttpGet("readCourse", `/course/read${q}`, {
        lazy: true
    })
}


/**
 * @description  精品推荐
 * @param { Object }  query
 * @returns
 */

export function useHotCourseListApi(query = {}) {
    return useHttpGet("HotCourseList", `/hot`, {
        lazy: true
    })
}


/**
 * @description  免费学习
 * @param { Object }  body
 * @returns
 */

export function useLearnApi(body = {}) {
    return useHttpPost("learn", `/order/learn`, {
        body
    })
}

